import { _decorator, Component, Node, Vec2 } from 'cc';
import { Battle } from '../Battle';
const { ccclass, property } = _decorator;

@ccclass('GridMoveController')
export class GridMoveController extends Component {

    //路线
    public paths: any[];
    public startCell: any;
    public endCell: any;

    start() {
        // let myThis = this;
        // this.scheduleOnce(function () {
        //     myThis.startCell = Battle.myGridManager.GetCell(myThis.node.position);
        //     myThis.endCell = Battle.myGridManager.GetCell(Battle.MainTowerNode.position);
        //     myThis.paths = Battle.myGridManager.onStartFindPath(myThis.startCell, myThis.endCell);

        //     // let data = Battle.myGridManager.GetCellByRowAndCol(0, 0);
        //     // let distance = Vec2.distance(myThis.node.position, data.pos);
        //     // console.log("distance :" + distance);
        //     console.log("搜索路线", myThis.paths);
        // }.bind(this), 3);
    }

}


